class CreateReviews < ActiveRecord::Migration
  def self.up
    create_table :reviews do |t|
      t.column :user_id, :integer
      t.column :article_id, :integer
      t.column :created_at, :datetime
      t.column :updated_at, :datetime
      t.column :document_id, :integer
      t.column :novelty_rating, :integer
      t.column :novelty_comments, :text
      t.column :literature_review_rating, :integer
      t.column :literature_review_comments, :text
      t.column :thesis_and_argument_rating, :integer
      t.column :thesis_and_argument_comments, :text
      t.column :findings_rating, :integer
      t.column :findings_comments, :text
      t.column :impression_rating, :integer
      t.column :impression_comments, :text
    end
    foreign_key :reviews, :user_id, :users
    foreign_key :reviews, :article_id, :articles
    foreign_key :reviews, :document_id, :documents
  end

  def self.down
    drop_table :reviews
  end
end
